$OpenBSD: patch-src_loadpng_cpp,v 1.1 2011/07/08 20:38:01 naddy Exp $

Fix build with png-1.5.

--- src/loadpng.cpp.orig	Wed Jul  6 14:42:57 2011
+++ src/loadpng.cpp	Wed Jul  6 14:44:02 2011
@@ -6,6 +6,7 @@
 
 
 #include <png.h>
+#include <zlib.h>
 #include <allegro.h>
 #include <allegro/internal/aintern.h>
 #include "loadpng.h"
@@ -276,7 +277,7 @@ BITMAP *load_png_pf(PACKFILE *fp, RGB *pal)
      * the normal method of doing things with libpng).  REQUIRED unless you
      * set up your own error handlers in the png_create_read_struct() earlier.
      */
-    if (setjmp(png_ptr->jmpbuf)) {
+    if (setjmp(png_jmpbuf(png_ptr))) {
 	/* Free all of the memory associated with the png_ptr and info_ptr */
 	png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
 	/* If we get here, we had a problem reading the file */
@@ -372,7 +373,7 @@ BITMAP *load_memory_png(AL_CONST void *buffer, int buf
      * the normal method of doing things with libpng).  REQUIRED unless you
      * set up your own error handlers in the png_create_read_struct() earlier.
      */
-    if (setjmp(png_ptr->jmpbuf)) {
+    if (setjmp(png_jmpbuf(png_ptr))) {
 	/* Free all of the memory associated with the png_ptr and info_ptr */
 	png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
 	/* If we get here, we had a problem reading the file */
@@ -644,7 +645,7 @@ static int really_save_png(PACKFILE *fp, BITMAP *bmp, 
 	goto Error;
 
     /* Set error handling. */
-    if (setjmp(png_ptr->jmpbuf)) {
+    if (setjmp(png_jmpbuf(png_ptr))) {
 	/* If we get here, we had a problem reading the file. */
 	goto Error;
     }
